//
//  RuleViewController.m
//  bitcoin
//
//  Created by caiyajun on 2018/6/13.
//  Copyright © 2018年 比特币. All rights reserved.
//

#import "RuleViewController.h"

@interface RuleViewController ()
@property (weak, nonatomic) IBOutlet UITextView *contentTV;

@end

@implementation RuleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"arrowleft-icon"] style:UIBarButtonItemStylePlain target:self action:@selector(backAction:)];
    self.navigationItem.leftBarButtonItem = back;
    
    
    NSMutableAttributedString * attrStr = [[NSMutableAttributedString alloc] initWithData:[self.rule dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
    [attrStr addAttribute:NSForegroundColorAttributeName value:RGBColor(225, 225, 225) range:NSMakeRange(0, attrStr.length)];
    self.contentTV.attributedText=attrStr;
}
- (void)backAction:(UIBarButtonItem *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
